
/*
'===============================================================================
'  Generated From - CSharp_dOOdads_BusinessEntity.vbgen
' 
'  ** IMPORTANT  ** 
'  How to Generate your stored procedures:
' 
'  SQL        = SQL_StoredProcs.vbgen
'  ACCESS     = Access_StoredProcs.vbgen
'  ORACLE     = Oracle_StoredProcs.vbgen
'  FIREBIRD   = FirebirdStoredProcs.vbgen
'  POSTGRESQL = PostgreSQL_StoredProcs.vbgen
'
'  The supporting base class OleDbEntity is in the Architecture directory in "dOOdads".
'  
'  This object is 'abstract' which means you need to inherit from it to be able
'  to instantiate it.  This is very easilly done. You can override properties and
'  methods in your derived class, this allows you to regenerate this class at any
'  time and not worry about overwriting custom code. 
'
'  NEVER EDIT THIS FILE.
'
'  public class YourObject :  _YourObject
'  {
'
'  }
'
'===============================================================================
*/

// Generated by MyGeneration Version # (1.3.0.3)

using System;
using System.Data;
using System.Data.OleDb;
using System.Collections;
using System.Collections.Specialized;

using MyGeneration.dOOdads;

namespace Alserve.Ffl.Data
{
	public abstract class _Transfer : OleDbEntity
	{
		public _Transfer()
		{
			this.QuerySource = "Transfer";
			this.MappingName = "Transfer";

		}	

		//=================================================================
		//  public Overrides void AddNew()
		//=================================================================
		//
		//=================================================================
		public override void AddNew()
		{
			base.AddNew();
			
		}
		
		
		public override string GetAutoKeyColumn()
		{
			return "Id";
		}

		public override void FlushData()
		{
			this._whereClause = null;
			this._aggregateClause = null;
			base.FlushData();
		}
		
		//=================================================================
		//  	public Function LoadAll() As Boolean
		//=================================================================
		//  Loads all of the records in the database, and sets the currentRow to the first row
		//=================================================================
		public bool LoadAll() 
		{
			ListDictionary parameters = null;
			
			return base.LoadFromSql("[" + this.SchemaStoredProcedure + "proc_TransferLoadAll]", parameters);
		}
	
		//=================================================================
		// public Overridable Function LoadByPrimaryKey()  As Boolean
		//=================================================================
		//  Loads a single row of via the primary key
		//=================================================================
		public virtual bool LoadByPrimaryKey(int Id)
		{
			ListDictionary parameters = new ListDictionary();
			parameters.Add(Parameters.Id, Id);

		
			return base.LoadFromSql("[" + this.SchemaStoredProcedure + "proc_TransferLoadByPrimaryKey]", parameters);
		}
		
		#region Parameters
		protected class Parameters
		{
			
			public static OleDbParameter Id
			{
				get
				{
					return new OleDbParameter("@Id", OleDbType.Numeric, 0);
				}
			}
			
			public static OleDbParameter NewPlayer
			{
				get
				{
					return new OleDbParameter("@NewPlayer", OleDbType.Boolean, 2);
				}
			}
			
			public static OleDbParameter PlayerId
			{
				get
				{
					return new OleDbParameter("@PlayerId", OleDbType.Numeric, 0);
				}
			}
			
			public static OleDbParameter ClubId
			{
				get
				{
					return new OleDbParameter("@ClubId", OleDbType.Numeric, 0);
				}
			}
			
			public static OleDbParameter EspnRef
			{
				get
				{
					return new OleDbParameter("@EspnRef", OleDbType.Numeric, 0);
				}
			}
			
			public static OleDbParameter PlayerName
			{
				get
				{
					return new OleDbParameter("@PlayerName", OleDbType.VarWChar, 255);
				}
			}
			
			public static OleDbParameter PositionId
			{
				get
				{
					return new OleDbParameter("@PositionId", OleDbType.Numeric, 0);
				}
			}
			
		}
		#endregion		
	
		#region ColumnNames
		public class ColumnNames
		{  
            public const string Id = "Id";
            public const string NewPlayer = "NewPlayer";
            public const string PlayerId = "PlayerId";
            public const string ClubId = "ClubId";
            public const string EspnRef = "EspnRef";
            public const string PlayerName = "PlayerName";
            public const string PositionId = "PositionId";

			static public string ToPropertyName(string columnName)
			{
				if(ht == null)
				{
					ht = new Hashtable();
					
					ht[Id] = _Transfer.PropertyNames.Id;
					ht[NewPlayer] = _Transfer.PropertyNames.NewPlayer;
					ht[PlayerId] = _Transfer.PropertyNames.PlayerId;
					ht[ClubId] = _Transfer.PropertyNames.ClubId;
					ht[EspnRef] = _Transfer.PropertyNames.EspnRef;
					ht[PlayerName] = _Transfer.PropertyNames.PlayerName;
					ht[PositionId] = _Transfer.PropertyNames.PositionId;

				}
				return (string)ht[columnName];
			}

			static private Hashtable ht = null;			 
		}
		#endregion
		
		#region PropertyNames
		public class PropertyNames
		{  
            public const string Id = "Id";
            public const string NewPlayer = "NewPlayer";
            public const string PlayerId = "PlayerId";
            public const string ClubId = "ClubId";
            public const string EspnRef = "EspnRef";
            public const string PlayerName = "PlayerName";
            public const string PositionId = "PositionId";

			static public string ToColumnName(string propertyName)
			{
				if(ht == null)
				{
					ht = new Hashtable();
					
					ht[Id] = _Transfer.ColumnNames.Id;
					ht[NewPlayer] = _Transfer.ColumnNames.NewPlayer;
					ht[PlayerId] = _Transfer.ColumnNames.PlayerId;
					ht[ClubId] = _Transfer.ColumnNames.ClubId;
					ht[EspnRef] = _Transfer.ColumnNames.EspnRef;
					ht[PlayerName] = _Transfer.ColumnNames.PlayerName;
					ht[PositionId] = _Transfer.ColumnNames.PositionId;

				}
				return (string)ht[propertyName];
			}

			static private Hashtable ht = null;			 
		}			 
		#endregion	

		#region StringPropertyNames
		public class StringPropertyNames
		{  
            public const string Id = "s_Id";
            public const string NewPlayer = "s_NewPlayer";
            public const string PlayerId = "s_PlayerId";
            public const string ClubId = "s_ClubId";
            public const string EspnRef = "s_EspnRef";
            public const string PlayerName = "s_PlayerName";
            public const string PositionId = "s_PositionId";

		}
		#endregion		
		
		#region Properties
	
		public virtual int Id
	    {
			get
	        {
				return base.Getint(ColumnNames.Id);
			}
			set
	        {
				base.Setint(ColumnNames.Id, value);
			}
		}

		public virtual bool NewPlayer
	    {
			get
	        {
				return base.Getbool(ColumnNames.NewPlayer);
			}
			set
	        {
				base.Setbool(ColumnNames.NewPlayer, value);
			}
		}

		public virtual int PlayerId
	    {
			get
	        {
				return base.Getint(ColumnNames.PlayerId);
			}
			set
	        {
				base.Setint(ColumnNames.PlayerId, value);
			}
		}

		public virtual int ClubId
	    {
			get
	        {
				return base.Getint(ColumnNames.ClubId);
			}
			set
	        {
				base.Setint(ColumnNames.ClubId, value);
			}
		}

		public virtual int EspnRef
	    {
			get
	        {
				return base.Getint(ColumnNames.EspnRef);
			}
			set
	        {
				base.Setint(ColumnNames.EspnRef, value);
			}
		}

		public virtual string PlayerName
	    {
			get
	        {
				return base.Getstring(ColumnNames.PlayerName);
			}
			set
	        {
				base.Setstring(ColumnNames.PlayerName, value);
			}
		}

		public virtual int PositionId
	    {
			get
	        {
				return base.Getint(ColumnNames.PositionId);
			}
			set
	        {
				base.Setint(ColumnNames.PositionId, value);
			}
		}


		#endregion
		
		#region String Properties
	
		public virtual string s_Id
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.Id) ? string.Empty : base.GetintAsString(ColumnNames.Id);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.Id);
				else
					this.Id = base.SetintAsString(ColumnNames.Id, value);
			}
		}

		public virtual string s_NewPlayer
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.NewPlayer) ? string.Empty : base.GetboolAsString(ColumnNames.NewPlayer);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.NewPlayer);
				else
					this.NewPlayer = base.SetboolAsString(ColumnNames.NewPlayer, value);
			}
		}

		public virtual string s_PlayerId
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.PlayerId) ? string.Empty : base.GetintAsString(ColumnNames.PlayerId);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.PlayerId);
				else
					this.PlayerId = base.SetintAsString(ColumnNames.PlayerId, value);
			}
		}

		public virtual string s_ClubId
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.ClubId) ? string.Empty : base.GetintAsString(ColumnNames.ClubId);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.ClubId);
				else
					this.ClubId = base.SetintAsString(ColumnNames.ClubId, value);
			}
		}

		public virtual string s_EspnRef
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.EspnRef) ? string.Empty : base.GetintAsString(ColumnNames.EspnRef);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.EspnRef);
				else
					this.EspnRef = base.SetintAsString(ColumnNames.EspnRef, value);
			}
		}

		public virtual string s_PlayerName
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.PlayerName) ? string.Empty : base.GetstringAsString(ColumnNames.PlayerName);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.PlayerName);
				else
					this.PlayerName = base.SetstringAsString(ColumnNames.PlayerName, value);
			}
		}

		public virtual string s_PositionId
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.PositionId) ? string.Empty : base.GetintAsString(ColumnNames.PositionId);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.PositionId);
				else
					this.PositionId = base.SetintAsString(ColumnNames.PositionId, value);
			}
		}


		#endregion		
	
		#region Where Clause
		public class WhereClause
		{
			public WhereClause(BusinessEntity entity)
			{
				this._entity = entity;
			}
			
			public TearOffWhereParameter TearOff
			{
				get
				{
					if(_tearOff == null)
					{
						_tearOff = new TearOffWhereParameter(this);
					}

					return _tearOff;
				}
			}

			#region WhereParameter TearOff's
			public class TearOffWhereParameter
			{
				public TearOffWhereParameter(WhereClause clause)
				{
					this._clause = clause;
				}
				
				
				public WhereParameter Id
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.Id, Parameters.Id);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter NewPlayer
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.NewPlayer, Parameters.NewPlayer);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter PlayerId
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.PlayerId, Parameters.PlayerId);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter ClubId
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.ClubId, Parameters.ClubId);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter EspnRef
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.EspnRef, Parameters.EspnRef);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter PlayerName
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.PlayerName, Parameters.PlayerName);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter PositionId
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.PositionId, Parameters.PositionId);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}


				private WhereClause _clause;
			}
			#endregion
		
			public WhereParameter Id
		    {
				get
		        {
					if(_Id_W == null)
	        	    {
						_Id_W = TearOff.Id;
					}
					return _Id_W;
				}
			}

			public WhereParameter NewPlayer
		    {
				get
		        {
					if(_NewPlayer_W == null)
	        	    {
						_NewPlayer_W = TearOff.NewPlayer;
					}
					return _NewPlayer_W;
				}
			}

			public WhereParameter PlayerId
		    {
				get
		        {
					if(_PlayerId_W == null)
	        	    {
						_PlayerId_W = TearOff.PlayerId;
					}
					return _PlayerId_W;
				}
			}

			public WhereParameter ClubId
		    {
				get
		        {
					if(_ClubId_W == null)
	        	    {
						_ClubId_W = TearOff.ClubId;
					}
					return _ClubId_W;
				}
			}

			public WhereParameter EspnRef
		    {
				get
		        {
					if(_EspnRef_W == null)
	        	    {
						_EspnRef_W = TearOff.EspnRef;
					}
					return _EspnRef_W;
				}
			}

			public WhereParameter PlayerName
		    {
				get
		        {
					if(_PlayerName_W == null)
	        	    {
						_PlayerName_W = TearOff.PlayerName;
					}
					return _PlayerName_W;
				}
			}

			public WhereParameter PositionId
		    {
				get
		        {
					if(_PositionId_W == null)
	        	    {
						_PositionId_W = TearOff.PositionId;
					}
					return _PositionId_W;
				}
			}

			private WhereParameter _Id_W = null;
			private WhereParameter _NewPlayer_W = null;
			private WhereParameter _PlayerId_W = null;
			private WhereParameter _ClubId_W = null;
			private WhereParameter _EspnRef_W = null;
			private WhereParameter _PlayerName_W = null;
			private WhereParameter _PositionId_W = null;

			public void WhereClauseReset()
			{
				_Id_W = null;
				_NewPlayer_W = null;
				_PlayerId_W = null;
				_ClubId_W = null;
				_EspnRef_W = null;
				_PlayerName_W = null;
				_PositionId_W = null;

				this._entity.Query.FlushWhereParameters();

			}
	
			private BusinessEntity _entity;
			private TearOffWhereParameter _tearOff;
			
		}
	
		public WhereClause Where
		{
			get
			{
				if(_whereClause == null)
				{
					_whereClause = new WhereClause(this);
				}
		
				return _whereClause;
			}
		}
		
		private WhereClause _whereClause = null;	
		#endregion
	
		#region Aggregate Clause
		public class AggregateClause
		{
			public AggregateClause(BusinessEntity entity)
			{
				this._entity = entity;
			}
			
			public TearOffAggregateParameter TearOff
			{
				get
				{
					if(_tearOff == null)
					{
						_tearOff = new TearOffAggregateParameter(this);
					}

					return _tearOff;
				}
			}

			#region AggregateParameter TearOff's
			public class TearOffAggregateParameter
			{
				public TearOffAggregateParameter(AggregateClause clause)
				{
					this._clause = clause;
				}
				
				
				public AggregateParameter Id
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.Id, Parameters.Id);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter NewPlayer
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.NewPlayer, Parameters.NewPlayer);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter PlayerId
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.PlayerId, Parameters.PlayerId);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter ClubId
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.ClubId, Parameters.ClubId);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter EspnRef
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.EspnRef, Parameters.EspnRef);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter PlayerName
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.PlayerName, Parameters.PlayerName);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter PositionId
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.PositionId, Parameters.PositionId);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}


				private AggregateClause _clause;
			}
			#endregion
		
			public AggregateParameter Id
		    {
				get
		        {
					if(_Id_W == null)
	        	    {
						_Id_W = TearOff.Id;
					}
					return _Id_W;
				}
			}

			public AggregateParameter NewPlayer
		    {
				get
		        {
					if(_NewPlayer_W == null)
	        	    {
						_NewPlayer_W = TearOff.NewPlayer;
					}
					return _NewPlayer_W;
				}
			}

			public AggregateParameter PlayerId
		    {
				get
		        {
					if(_PlayerId_W == null)
	        	    {
						_PlayerId_W = TearOff.PlayerId;
					}
					return _PlayerId_W;
				}
			}

			public AggregateParameter ClubId
		    {
				get
		        {
					if(_ClubId_W == null)
	        	    {
						_ClubId_W = TearOff.ClubId;
					}
					return _ClubId_W;
				}
			}

			public AggregateParameter EspnRef
		    {
				get
		        {
					if(_EspnRef_W == null)
	        	    {
						_EspnRef_W = TearOff.EspnRef;
					}
					return _EspnRef_W;
				}
			}

			public AggregateParameter PlayerName
		    {
				get
		        {
					if(_PlayerName_W == null)
	        	    {
						_PlayerName_W = TearOff.PlayerName;
					}
					return _PlayerName_W;
				}
			}

			public AggregateParameter PositionId
		    {
				get
		        {
					if(_PositionId_W == null)
	        	    {
						_PositionId_W = TearOff.PositionId;
					}
					return _PositionId_W;
				}
			}

			private AggregateParameter _Id_W = null;
			private AggregateParameter _NewPlayer_W = null;
			private AggregateParameter _PlayerId_W = null;
			private AggregateParameter _ClubId_W = null;
			private AggregateParameter _EspnRef_W = null;
			private AggregateParameter _PlayerName_W = null;
			private AggregateParameter _PositionId_W = null;

			public void AggregateClauseReset()
			{
				_Id_W = null;
				_NewPlayer_W = null;
				_PlayerId_W = null;
				_ClubId_W = null;
				_EspnRef_W = null;
				_PlayerName_W = null;
				_PositionId_W = null;

				this._entity.Query.FlushAggregateParameters();

			}
	
			private BusinessEntity _entity;
			private TearOffAggregateParameter _tearOff;
			
		}
	
		public AggregateClause Aggregate
		{
			get
			{
				if(_aggregateClause == null)
				{
					_aggregateClause = new AggregateClause(this);
				}
		
				return _aggregateClause;
			}
		}
		
		private AggregateClause _aggregateClause = null;	
		#endregion
	
		protected override IDbCommand GetInsertCommand() 
		{
		
			OleDbCommand cmd = new OleDbCommand();
			cmd.CommandType = CommandType.StoredProcedure;
			cmd.CommandText = "[" + this.SchemaStoredProcedure + "proc_TransferInsert]";
	
			CreateParameters(cmd);
			    
			return cmd;
		}
	
		protected override IDbCommand GetUpdateCommand()
		{
		
			OleDbCommand cmd = new OleDbCommand();
			cmd.CommandType = CommandType.StoredProcedure;
			cmd.CommandText = "[" + this.SchemaStoredProcedure + "proc_TransferUpdate]";
	
			CreateParameters(cmd);
			      
			return cmd;
		}
	
		protected override IDbCommand GetDeleteCommand()
		{
		
			OleDbCommand cmd = new OleDbCommand();
			cmd.CommandType = CommandType.StoredProcedure;
			cmd.CommandText = "[" + this.SchemaStoredProcedure + "proc_TransferDelete]";
	
			OleDbParameter p;
			p = cmd.Parameters.Add(Parameters.Id);
			p.SourceColumn = ColumnNames.Id;
			p.SourceVersion = DataRowVersion.Current;

  
			return cmd;
		}
		
		private IDbCommand CreateParameters(OleDbCommand cmd)
		{
			OleDbParameter p;
		
			p = cmd.Parameters.Add(Parameters.Id);
			p.SourceColumn = ColumnNames.Id;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.NewPlayer);
			p.SourceColumn = ColumnNames.NewPlayer;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.PlayerId);
			p.SourceColumn = ColumnNames.PlayerId;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.ClubId);
			p.SourceColumn = ColumnNames.ClubId;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.EspnRef);
			p.SourceColumn = ColumnNames.EspnRef;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.PlayerName);
			p.SourceColumn = ColumnNames.PlayerName;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.PositionId);
			p.SourceColumn = ColumnNames.PositionId;
			p.SourceVersion = DataRowVersion.Current;


			return cmd;
		}
	}
}
